print('1.火车买票问题')
dict_ticket = {'G1569':['北京南-天津南','18:05','18:39','00:34'],
        'G1567':['北京南-上海南','18:15','18:49','00:34'],
        'G8719':['北京南-重庆东','18:20','18:59','00:59'],
        'G203 ':['北京南-天津西','18:35','17:19','01:34']}
print('车次\t\t出发站-到达站\t\t出发时间\t\t到达时间\t\t历时时长')
for item in dict_ticket:
    print(item, end="\t")
    for i in dict_ticket[item]:
        print(i, end= "\t\t")
    print() #换行
#输入要购买的车次
train_no = input("请输入您需要购买的车次:")
persons = input("请输入乘车人,如果乘车人是多人,请用逗号分割:")
s = f'您已经购买了{train_no}次车票'
print(s)
s_info = dict_ticket[train_no] #获取车次详细信息
print(s_info)
s += s_info[0] +' ' + s_info[1] +' 开, '
print(s)
print(f'{s}请{persons}尽快取走纸质车票【中国铁运】')
